Virtual fields

A virtual field is not a column in a table and it is not used to store data: it is used to display data from another module.

Hosp./Clinic: (Child) in the Births module is an example of a virtual field: it is an attachment field which displays Summary Data (SummaryData) of a record in the Parties module. The Summary Data is not itself stored in the Births module. What is stored in a reference field hidden from the user is the IRN of the attached Parties record.

For example, a record in the Births module attaches to a record in the Parties module (a Hospital) via the Hosp./Clinic: (Child) field. SummaryData from a Parties record displays in the Hosp./Clinic: (Child) field.

In an attachment there is a reference column in the Primary module (the module from which the attachment is made) which stores the IRN of the attached record. This column is hidden from users. Data from the attached record does display in a virtual field (the virtual field points to the hidden reference field which points to the attached record in the Parties module).

In this example, the Hosp./Clinic: (Child) field is a virtual field called BirthFacilityName, and it points to a reference field called BirthFacilityName_Ref, which in turn points to the SummaryData field in an attached record in the Parties module.

When a search is made of a virtual field, two Also Searches may take place. In this Births example:

  1. An Also Search Registry entry for BirthFacilityName can specify additional fields in the Births module to be searched.
  2. If there is an Also Search Registry entry for SummaryData in the Parties module (the column referenced by BirthFacilityName), a search of BirthFacilityName in the Births module will also search the Parties module columns listed in the Also Search Registry entry for SummaryData.